The present inventive concept relates to a method for managing data in a storage device.
Generally, a non-volatile memory device is widely used as a storage medium for storing and processing data in an embedded system such as a household appliance, a communication device, a set-top box, etc.
The non-volatile memory device has both an advantage of a random access memory (RAM) that the data can be freely written or erased, and an advantage of a read only memory (ROM) that the data stored can be retained even without a supply of power.
Further, a flash memory device that is widely used among non-volatile memory devices is a non-volatile memory element which can electrically erase or rewrite data. The flash memory device is suitable for a mobile apparatus or the like because it has a small size, has a fast access time like a hard disk, and has low power consumption compared to a storage medium based on a magnetic disk memory.
In such a non-volatile memory device, if the data is updated, the existing page on which the data has been written remains invalid, and a new page is allocated such that data to be updated is written on the new page. In this case, if the available space in insufficient in the non-volatile memory device, garbage collection for collecting only valid pages is performed to increase the available space.
Meanwhile, the time required for performing the garbage collection may serve as a load factor reducing the performance of the non-volatile memory device. Thus, the shorter the time required for performing the garbage collection during the operation of the non-volatile memory device, the better the entire performance of the device.